<% if flash[:success] %>
  <p class="success"><%=flash[:success]%></p>
  <% flash.discard %>
<% else %>
<p class="note">Make sure you change the name of the file to something memorable before you upload. You will need the filename to add it to a wiki page.</p>
<% end %>

<% @<%= file_name %>_asset = <%= class_name %>Asset.new unless @<%= file_name %>_asset %>
<% form_for(@<%= file_name %>_asset, :url => asset_path(:id => nil, :format => 'js'), :html => {:multipart => true, :target => "new_<%= file_name %>_asset_iframe"}) do |f| %>
  <%= error_messages_for :<%= file_name %>_asset %>

  <p><label for="<%= file_name %>_asset_file">File:</label><br/>
  <%= upload_column_field '<%= file_name %>_asset', 'file' %></p>
  
  <p><label for="<%= file_name %>_asset_caption">Caption:</label><br/>
  <%= f.text_field "caption" %></p>
  
  <p>
    <%= f.submit "Upload File" %>
  </p>
<% end %>
<iframe id="new_<%= file_name %>_asset_iframe" name="new_<%= file_name %>_asset_iframe" style="width:1px;height:1px;"></iframe>
